﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DelonixRegiaHMSys.Core.Interfaces;
using DelonixRegiaHMSys.Core.Models;

namespace DelonixRegiaHMSys.Core.Services
{
    public class saServices
    {
        private readonly ISystemAccountQuery _systemAccountQuery;
        public saServices(ISystemAccountQuery systemAccountQuery)
        {
            _systemAccountQuery = systemAccountQuery;
        }

        public IEnumerable<SystemAccount> GetAll()
        {
            return _systemAccountQuery.GetAll();
        }

        public void AddUser(SystemAccount sa)
        {
            _systemAccountQuery.AddUser(sa);
        }

        public void DeleteUser(string userID)
        {
            _systemAccountQuery.DeleteUser(userID);
        }

        public void UpdateUser(SystemAccount sa)
        {
            _systemAccountQuery.UpdateUser(sa);
        }

        public bool DoesTheAccountExist(string userID, string password)
        {
            return _systemAccountQuery.DoesTheAccountExist(userID, password);
        }

        public void UpdateUserStatus(string userID, string userStatus)
        {
            _systemAccountQuery.UpdateUserStatus(userID, userStatus);
        }

        public bool IsAdmin(string userID)
        {
            return _systemAccountQuery.IsAdminOrMS(userID);
        }

        public bool IsAdminOrMS(string userID)
        {
            return _systemAccountQuery.IsAdminOrMS(userID);
        }

        public bool IsUserOnline(string userID)
        {
            return _systemAccountQuery.IsUserOnline(userID);
        }

        public bool StaffHasAccount(string staffID)
        {
            return _systemAccountQuery.StaffHasAccount(staffID);
        }
    }
}
